home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Celestin Apprentice 5
/
Apprentice-Release5.iso
/
Source Code
/
Libraries
/
Sherlock 2.0
/
DevLibSrc
/
Mac DevLib
/
mac_about_dialog.c
next >
Wrap
Text File
|
1996-02-05
|
2KB
|
118 lines
/*
devlib: about dialog.
This file is used only on the Macintosh.
source: mac_about_dialog.c
started: November 30, 1990
version:
February 5, 1996.
Added support for Symantec C.
November 2, 1995.
changed w_update to slw_update.
September 25, 1995.
#include <Segload.h>.
January 7, 1994.
*/
/* Include this before sl.h is included. */
#include <Menus.h>
#include <LIBlib.h>
#include <LIBdialog.h>
#include <mac_gui.h>
#include <string.h>
#if defined(THINK_C) || defined(SYMANTEC_C)
#include <pascal.h>
#endif
#ifdef applec
#include <Strings.h>
#endif
#ifdef __MWERKS__
#include <Segload.h>
#endif
/*
Define resource numbers.
*/
#define ABOUT_ALERT 128 /* 'ALRT' resource. */
#define LIB_ABOUT_RES_ID 129
/*
Define item numbers.
*/
#define OK_ITEM 1 /* About dialog. */
#define VERSION_ITEM 2
#define bound screenBits.bounds
/*
Handle the "About..." dialog.
*/
void
about_dialog(void)
{
DialogPtr dp;
short itemHit;
Rect tempRect;
short DType;
Handle DItem;
ControlHandle CItem;
GrafPtr old_port;
SL_DISABLE();
/* Save the old GrafPort */
GetPort(&old_port);
dp = GetNewDialog(LIB_ABOUT_RES_ID, NULL, (WindowPtr)-1);
if (dp == NULL) {
#ifndef LIB_DONT_USE_ES
es("Can not find About dialog!!\n");
#endif
SysBeep(20);
while(!Button()) {
;
}
ExitToShell();
}
/* Get the version strings from the resource file. */
GetDItem(dp, VERSION_ITEM, &DType, &DItem, &tempRect);
/* Center the dialog horizontally. */
center_dialog(dp);
ShowWindow(dp);
SelectWindow(dp);
SetPort(dp);
/* Setup initial conditions */
hiliteButton(dp);
for(;;) {
ModalDialog(NULL, &itemHit);
GetDItem(dp, itemHit, &DType, &DItem, &tempRect);
CItem = (ControlHandle) DItem;
/* Handle it real time */
if (itemHit == OK_ITEM) {
DisposDialog(dp);
/* Update the Sherlock window if it is present. */
#ifdef SHERLOCK
slw_update();
#endif
break;
}
}
/* Restore the GrafPort */
SetPort(old_port);
}